home *** CD-ROM | disk | FTP | other *** search
/ Workbench Add-On / Workbench Add-On - Volume 1.iso / BBS-Archive / Comm / term-source.lha / Extras / Source / term-Source.lha / LibPanelPlus.c < prev    next >
C/C++ Source or Header  |  1995-07-08  |  14KB  |  654 lines

  1. /*
  2. **    LibPanelPlus.c
  3. **
  4. **    Editing panel for transfer library configuration
  5. **
  6. **    Copyright © 1990-1995 by Olaf `Olsen' Barthel
  7. **        All Rights Reserved
  8. */
  9.  
  10. #include "termGlobal.h"
  11.  
  12. enum    {    GAD_COMMAND=1000,
  13.         GAD_BUTTON1,GAD_BUTTON2,GAD_BUTTON3,GAD_BUTTON4,GAD_BUTTON5,
  14.         GAD_BUTTON6,GAD_BUTTON7,GAD_BUTTON8,GAD_BUTTON9,GAD_BUTTON10,
  15.         GAD_PAGER,GAD_PAGEGROUP,
  16.  
  17.         GAD_USE,GAD_CANCEL
  18.     };
  19.  
  20. STATIC STRPTR __saveds
  21. ShowTime(struct Gadget *SomeGadget,WORD Level)
  22. {
  23.     return(LocaleSeconds(Level));
  24. }
  25.  
  26. VOID __regargs
  27. ASCIITransferPanel(struct Window *Window,struct Configuration *Config)
  28. {
  29.     STATIC LONG PageTitleID[4] =
  30.     {
  31.         MSG_INTERNAL_ASCII_TRANSFER_SEND_TXT,
  32.         MSG_INTERNAL_ASCII_TRANSFER_RECEIVE_TXT,
  33.         MSG_INTERNAL_ASCII_TRANSFER_GENERAL_TXT,
  34.         -1
  35.     };
  36.  
  37.     STATIC BYTE InitialPage = 0;
  38.  
  39.     struct TransferSettings     OldSettings;
  40.     struct LayoutHandle    *Handle;
  41.     STRPTR             PageTitle[4];
  42.  
  43.     LocalizeStringTable(PageTitle,PageTitleID);
  44.  
  45.     CopyMem(Config -> TransferConfig,&OldSettings,sizeof(struct TransferSettings));
  46.  
  47.     if(Handle = LT_CreateHandleTags(Window -> WScreen,
  48.         LH_LocaleHook,    &LocaleHook,
  49.     TAG_DONE))
  50.     {
  51.         struct Window *PanelWindow;
  52.  
  53.         LT_New(Handle,
  54.             LA_Type,    VERTICAL_KIND,
  55.         TAG_DONE);
  56.         {
  57.             LT_New(Handle,
  58.                 LA_Type,    VERTICAL_KIND,
  59.             TAG_DONE);
  60.             {
  61.                 LT_New(Handle,
  62.                     LA_Type,        CYCLE_KIND,
  63.                     LA_LabelID,        MSG_XFER_PAGE_TXT,
  64.                     GTCY_Labels,        PageTitle,
  65.                     LACY_AutoPageID,    GAD_PAGEGROUP,
  66.                     LACY_TabKey,        TRUE,
  67.                     LA_BYTE,        &InitialPage,
  68.                 TAG_DONE);
  69.  
  70.                 LT_EndGroup(Handle);
  71.             }
  72.  
  73.             LT_New(Handle,
  74.                 LA_Type,    VERTICAL_KIND,
  75.                 LA_ID,        GAD_PAGEGROUP,
  76.                 LAGR_Frame,    TRUE,
  77.                 LAGR_ActivePage,InitialPage,
  78.             TAG_DONE);
  79.             {
  80.                 LT_New(Handle,
  81.                     LA_Type,    VERTICAL_KIND,
  82.                 TAG_DONE);
  83.                 {
  84.                     LT_New(Handle,
  85.                         LA_Type,    VERTICAL_KIND,
  86.                     TAG_DONE);
  87.                     {
  88.                         LT_New(Handle,
  89.                             LA_Type,    CYCLE_KIND,
  90.                             LA_LabelID,    MSG_CLIPPANEL_TEXT_PACING_GAD,
  91.                             LA_UBYTE,    &Config -> TransferConfig -> PacingMode,
  92.                             LACY_FirstLabel,MSG_CLIPPANEL_DIRECT_TXT,
  93.                             LACY_LastLabel,    MSG_CLIPPANEL_KEYDELAY_TXT,
  94.                         TAG_DONE);
  95.  
  96.                         LT_EndGroup(Handle);
  97.                     }
  98.  
  99.                     LT_New(Handle,
  100.                         LA_Type,    VERTICAL_KIND,
  101.                         LA_LabelID,    MSG_V36_0021,
  102.                     TAG_DONE);
  103.                     {
  104.                         LT_New(Handle,
  105.                             LA_Type,        SliderType,
  106.                             LA_LabelID,        MSG_CLIPPANEL_CHAR_DELAY_GAD,
  107.                             GTSL_Min,        0,
  108.                             GTSL_Max,        10 * 100,
  109.                             LA_Chars,        10,
  110.                             LA_WORD,        &Config -> TransferConfig -> CharDelay,
  111.                             GTSL_LevelFormat,    "%s s",
  112.                             GTSL_DispFunc,        ShowTime,
  113.                         TAG_DONE);
  114.  
  115.                         LT_New(Handle,
  116.                             LA_Type,        SliderType,
  117.                             LA_LabelID,        MSG_CLIPPANEL_LINE_DELAY_GAD,
  118.                             GTSL_Min,        0,
  119.                             GTSL_Max,        10 * 100,
  120.                             LA_Chars,        10,
  121.                             LA_WORD,        &Config -> TransferConfig -> LineDelay,
  122.                             GTSL_LevelFormat,    "%s s",
  123.                             GTSL_DispFunc,        ShowTime,
  124.                         TAG_DONE);
  125.  
  126.                         LT_EndGroup(Handle);
  127.                     }
  128.  
  129.                     LT_New(Handle,
  130.                         LA_Type,    VERTICAL_KIND,
  131.                         LA_LabelID,    MSG_V36_0024,
  132.                     TAG_DONE);
  133.                     {
  134.                         LT_New(Handle,
  135.                             LA_Type,        STRING_KIND,
  136.                             LA_LabelID,        MSG_CLIPPANEL_LINE_PROMPT_GAD,
  137.                             LA_STRPTR,        Config -> TransferConfig -> LinePrompt,
  138.                             LA_Chars,        10,
  139.                             GTST_MaxChars,        255,
  140.                         TAG_DONE);
  141.  
  142.                         LT_New(Handle,
  143.                             LA_Type,        SliderType,
  144.                             LA_LabelID,        MSG_CLIPPANEL_SEND_TIMEOUT_GAD,
  145.                             GTSL_Min,        0,
  146.                             GTSL_Max,        10 * 100,
  147.                             LA_WORD,        &Config -> TransferConfig -> SendTimeout,
  148.                             GTSL_LevelFormat,    "%s s",
  149.                             GTSL_DispFunc,        ShowTime,
  150.                         TAG_DONE);
  151.  
  152.                         LT_EndGroup(Handle);
  153.                     }
  154.  
  155.  
  156.                     LT_New(Handle,
  157.                         LA_Type,    VERTICAL_KIND,
  158.                     TAG_DONE);
  159.                     {
  160.                         LT_New(Handle,
  161.                             LA_Type,    CYCLE_KIND,
  162.                             LA_LabelID,    MSG_TERMINALPANEL_SEND_CR_GAD,
  163.                             LA_BYTE,    &Config -> TransferConfig -> SendCR,
  164.                             GTCY_Labels,    EOL_Labels,
  165.                         TAG_DONE);
  166.  
  167.                         LT_New(Handle,
  168.                             LA_Type,    CYCLE_KIND,
  169.                             LA_LabelID,    MSG_TERMINALPANEL_SEND_LF_GAD,
  170.                             LA_BYTE,    &Config -> TransferConfig -> SendLF,
  171.                             GTCY_Labels,    EOL_Labels,
  172.                         TAG_DONE);
  173.  
  174.                         LT_EndGroup(Handle);
  175.                     }
  176.  
  177.                     LT_EndGroup(Handle);
  178.                 }
  179.  
  180.                 LT_New(Handle,
  181.                     LA_Type,    VERTICAL_KIND,
  182.                 TAG_DONE);
  183.                 {
  184.                     LT_New(Handle,
  185.                         LA_Type,    CYCLE_KIND,
  186.                         LA_LabelID,    MSG_TERMINALPANEL_RECEIVE_CR_GAD,
  187.                         LA_BYTE,    &Config -> TransferConfig -> ReceiveCR,
  188.                         GTCY_Labels,    EOL_Labels,
  189.                     TAG_DONE);
  190.  
  191.                     LT_New(Handle,
  192.                         LA_Type,    CYCLE_KIND,
  193.                         LA_LabelID,    MSG_TERMINALPANEL_RECEIVE_LF_GAD,
  194.                         LA_BYTE,    &Config -> TransferConfig -> ReceiveLF,
  195.                         GTCY_Labels,    EOL_Labels,
  196.                     TAG_DONE);
  197.  
  198.                     LT_New(Handle,
  199.                         LA_Type,    CHECKBOX_KIND,
  200.                         LA_LabelID,    MSG_INTERNAL_ASCII_TRANSFER_IGNORE_DATA_PAST_ARNOLD_TXT,
  201.                         LA_BYTE,    &Config -> TransferConfig -> IgnoreDataPastArnold,
  202.                     TAG_DONE);
  203.  
  204.                     LT_New(Handle,
  205.                         LA_Type,    INTEGER_KIND,
  206.                         LA_LabelID,    MSG_INTERNAL_ASCII_TRANSFER_TERMINATOR_CHAR_TXT,
  207.                         LA_BYTE,    &Config -> TransferConfig -> TerminatorChar,
  208.                         LAIN_Min,    0,
  209.                         LAIN_Max,    255,
  210.                     TAG_DONE);
  211.  
  212.                     LT_EndGroup(Handle);
  213.                 }
  214.  
  215.                 LT_New(Handle,
  216.                     LA_Type,    VERTICAL_KIND,
  217.                 TAG_DONE);
  218.                 {
  219.                     LT_New(Handle,
  220.                         LA_Type,    CHECKBOX_KIND,
  221.                         LA_LabelID,    MSG_LIBPANEL_QUIET_TRANSFER_GAD,
  222.                         LA_BYTE,    &Config -> TransferConfig -> QuietTransfer,
  223.                     TAG_DONE);
  224.  
  225.                     LT_New(Handle,
  226.                         LA_Type,    CHECKBOX_KIND,
  227.                         LA_LabelID,    MSG_INTERNAL_ASCII_TRANSFER_STRIP_BIT_7_TXT,
  228.                         LA_BYTE,    &Config -> TransferConfig -> StripBit8,
  229.                     TAG_DONE);
  230.  
  231.                     LT_EndGroup(Handle);
  232.                 }
  233.  
  234.                 LT_EndGroup(Handle);
  235.             }
  236.  
  237.             LT_New(Handle,
  238.                 LA_Type,VERTICAL_KIND,
  239.             TAG_DONE);
  240.             {
  241.                 LT_New(Handle,
  242.                     LA_Type,    XBAR_KIND,
  243.                     LAXB_FullSize,    TRUE,
  244.                 TAG_DONE);
  245.  
  246.                 LT_EndGroup(Handle);
  247.             }
  248.  
  249.             LT_New(Handle,LA_Type,HORIZONTAL_KIND,
  250.                 LAGR_SameSize,    TRUE,
  251.                 LAGR_Spread,    TRUE,
  252.             TAG_DONE);
  253.             {
  254.                 LT_New(Handle,
  255.                     LA_Type,    BUTTON_KIND,
  256.                     LA_LabelID,    MSG_GLOBAL_USE_GAD,
  257.                     LA_ID,        GAD_USE,
  258.                     LABT_ReturnKey,    TRUE,
  259.                     LABT_ExtraFat,    TRUE,
  260.                 TAG_DONE);
  261.  
  262.                 LT_New(Handle,
  263.                     LA_Type,    BUTTON_KIND,
  264.                     LA_LabelID,    MSG_GLOBAL_CANCEL_GAD,
  265.                     LA_ID,        GAD_CANCEL,
  266.                     LABT_EscKey,    TRUE,
  267.                     LABT_ExtraFat,    TRUE,
  268.                 TAG_DONE);
  269.  
  270.                 LT_EndGroup(Handle);
  271.             }
  272.  
  273.             LT_EndGroup(Handle);
  274.         }
  275.  
  276.         if(PanelWindow = LT_Layout(Handle,LocaleString(MSG_INTERNAL_ASCII_TRANSFER_TRANSFER_TXT),NULL,0,0,IDCMP_CLOSEWINDOW,0,
  277.             LAWN_HelpHook,        &GuideHook,
  278.             LAWN_Parent,        Window,
  279.             WA_DepthGadget,        TRUE,
  280.             WA_CloseGadget,        TRUE,
  281.             WA_DragBar,        TRUE,
  282.             WA_RMBTrap,        TRUE,
  283.             WA_Activate,        TRUE,
  284.         TAG_DONE))
  285.         {
  286.             struct IntuiMessage    *Message;
  287.             BOOLEAN             Done = FALSE;
  288.             ULONG             MsgClass,
  289.                          MsgQualifier;
  290.             UWORD             MsgCode;
  291.             struct Gadget        *MsgGadget;
  292.  
  293.             GuideContext(CONTEXT_ASCII_TRANSFER_SETTINGS);
  294.  
  295.             PushWindow(PanelWindow);
  296.  
  297.             LT_ShowWindow(Handle,TRUE);
  298.  
  299.             do
  300.             {
  301.                 if(Wait(PORTMASK(PanelWindow -> UserPort) | SIG_BREAK) & SIG_BREAK)
  302.                 {
  303.                     CopyMem(&OldSettings,Config -> TransferConfig,sizeof(struct TransferSettings));
  304.  
  305.                     break;
  306.                 }
  307.  
  308.                 while(Message = (struct IntuiMessage *)GT_GetIMsg(PanelWindow -> UserPort))
  309.                 {
  310.                     MsgClass    = Message -> Class;
  311.                     MsgQualifier    = Message -> Qualifier;
  312.                     MsgCode        = Message -> Code;
  313.                     MsgGadget    = (struct Gadget *)Message -> IAddress;
  314.  
  315.                     GT_ReplyIMsg(Message);
  316.  
  317.                     LT_HandleInput(Handle,MsgQualifier,&MsgClass,&MsgCode,&MsgGadget);
  318.  
  319.                     if(MsgClass == IDCMP_CLOSEWINDOW)
  320.                     {
  321.                         CopyMem(&OldSettings,Config -> TransferConfig,sizeof(struct TransferSettings));
  322.  
  323.                         Done = TRUE;
  324.                     }
  325.  
  326.                     if(MsgClass == IDCMP_GADGETUP)
  327.                     {
  328.                         switch(MsgGadget -> GadgetID)
  329.                         {
  330.                             case GAD_USE:
  331.  
  332.                                 LT_UpdateStrings(Handle);
  333.  
  334.                                 Done = TRUE;
  335.                                 break;
  336.  
  337.                             case GAD_CANCEL:
  338.  
  339.                                 CopyMem(&OldSettings,Config -> TransferConfig,sizeof(struct TransferSettings));
  340.  
  341.                                 Done = TRUE;
  342.                                 break;
  343.                         }
  344.                     }
  345.                 }
  346.             }
  347.             while(!Done);
  348.  
  349.             PopWindow();
  350.         }
  351.  
  352.         LT_DeleteHandle(Handle);
  353.     }
  354. }
  355.  
  356. BOOLEAN __regargs
  357. ExternalCommandPanel(struct Window *Parent,STRPTR Command)
  358. {
  359.     LayoutHandle    *Handle;
  360.     BOOLEAN         Result = FALSE;
  361.  
  362.     if(Handle = LT_CreateHandleTags(Parent -> WScreen,
  363.         LH_LocaleHook,    &LocaleHook,
  364.     TAG_DONE))
  365.     {
  366.         STATIC LONG ButtonLabels[] =
  367.         {
  368.             MSG_XFER_BUTTON1_TXT,MSG_XFER_BUTTON2_TXT,
  369.             MSG_XFER_BUTTON3_TXT,MSG_XFER_BUTTON4_TXT,
  370.             MSG_XFER_BUTTON5_TXT,MSG_XFER_BUTTON6_TXT,
  371.             MSG_XFER_BUTTON7_TXT,MSG_XFER_BUTTON8_TXT,
  372.             MSG_XFER_BUTTON9_TXT,MSG_XFER_BUTTON10_TXT,
  373.         };
  374.  
  375.         struct Window    *PanelWindow;
  376.         UBYTE         LocalCommand[MAX_FILENAME_LENGTH];
  377.         WORD         i,Len,Max;
  378.  
  379.         strcpy(LocalCommand,Command);
  380.  
  381.         for(i = Max = 0 ; i < 10 ; i++)
  382.         {
  383.             if((Len = LT_LabelChars(Handle,LocaleString(ButtonLabels[i]))) > Max)
  384.                 Max = Len;
  385.         }
  386.  
  387.         LT_New(Handle,
  388.             LA_Type,    VERTICAL_KIND,
  389.         TAG_DONE);
  390.         {
  391.             LT_New(Handle,
  392.                 LA_Type,    VERTICAL_KIND,
  393.             TAG_DONE);
  394.             {
  395.                 LT_New(Handle,
  396.                     LA_Type,    STRING_KIND,
  397.                     LA_ID,        GAD_COMMAND,
  398.                     LA_LabelID,    MSG_XFER_COMMAND_TXT,
  399.                     LA_Chars,    50,
  400.                     LA_STRPTR,    LocalCommand,
  401.                     GTST_MaxChars,    MAX_FILENAME_LENGTH,
  402.                     LAST_Picker,    TRUE,
  403.                 TAG_DONE);
  404.  
  405.                 LT_New(Handle,
  406.                     LA_Type,    XBAR_KIND,
  407.                 TAG_DONE);
  408.  
  409.                 LT_EndGroup(Handle);
  410.             }
  411.  
  412.             LT_New(Handle,
  413.                 LA_Type,    VERTICAL_KIND,
  414.             TAG_DONE);
  415.             {
  416.                 LT_New(Handle,
  417.                     LA_Type,    HORIZONTAL_KIND,
  418.                     LAGR_SameSize,    TRUE,
  419.                 TAG_DONE);
  420.                 {
  421.                     for(i = 0 ; i < 5 ; i++)
  422.                     {
  423.                         LT_New(Handle,
  424.                             LA_Type,    BUTTON_KIND,
  425.                             LA_Chars,    Max,
  426.                             LA_ID,        GAD_BUTTON1 + i,
  427.                             LA_LabelID,    ButtonLabels[i],
  428.                         TAG_DONE);
  429.                     }
  430.  
  431.                     LT_EndGroup(Handle);
  432.                 }
  433.  
  434.                 LT_New(Handle,
  435.                     LA_Type,    HORIZONTAL_KIND,
  436.                     LAGR_SameSize,    TRUE,
  437.                 TAG_DONE);
  438.                 {
  439.                     for(i = 5 ; i < 10 ; i++)
  440.                     {
  441.                         LT_New(Handle,
  442.                             LA_Type,    BUTTON_KIND,
  443.                             LA_Chars,    Max,
  444.                             LA_ID,        GAD_BUTTON1 + i,
  445.                             LA_LabelID,    ButtonLabels[i],
  446.                         TAG_DONE);
  447.                     }
  448.  
  449.                     LT_EndGroup(Handle);
  450.                 }
  451.  
  452.                 LT_EndGroup(Handle);
  453.             }
  454.  
  455.             LT_New(Handle,
  456.                 LA_Type,VERTICAL_KIND,
  457.             TAG_DONE);
  458.             {
  459.                 LT_New(Handle,
  460.                     LA_Type,    XBAR_KIND,
  461.                     LAXB_FullSize,    TRUE,
  462.                 TAG_DONE);
  463.  
  464.                 LT_EndGroup(Handle);
  465.             }
  466.  
  467.             LT_New(Handle,LA_Type,HORIZONTAL_KIND,
  468.                 LAGR_SameSize,    TRUE,
  469.                 LAGR_Spread,    TRUE,
  470.             TAG_DONE);
  471.             {
  472.                 LT_New(Handle,
  473.                     LA_Type,    BUTTON_KIND,
  474.                     LA_LabelID,    MSG_GLOBAL_USE_GAD,
  475.                     LA_ID,        GAD_USE,
  476.                     LABT_ReturnKey,    TRUE,
  477.                     LABT_ExtraFat,    TRUE,
  478.                 TAG_DONE);
  479.  
  480.                 LT_New(Handle,
  481.                     LA_Type,    BUTTON_KIND,
  482.                     LA_LabelID,    MSG_GLOBAL_CANCEL_GAD,
  483.                     LA_ID,        GAD_CANCEL,
  484.                     LABT_EscKey,    TRUE,
  485.                     LABT_ExtraFat,    TRUE,
  486.                 TAG_DONE);
  487.  
  488.                 LT_EndGroup(Handle);
  489.             }
  490.  
  491.             LT_EndGroup(Handle);
  492.         }
  493.  
  494.         if(PanelWindow = LT_Build(Handle,
  495.             LAWN_TitleID,        MSG_EXTERNAL_PROGRAM_TXT,
  496.             LAWN_IDCMP,        IDCMP_CLOSEWINDOW,
  497.             LAWN_HelpHook,        &GuideHook,
  498.             LAWN_Parent,        Parent,
  499.             WA_DepthGadget,        TRUE,
  500.             WA_CloseGadget,        TRUE,
  501.             WA_DragBar,        TRUE,
  502.             WA_RMBTrap,        TRUE,
  503.             WA_Activate,        TRUE,
  504.         TAG_DONE))
  505.         {
  506.             STATIC STRPTR Strings[] =
  507.             {
  508.                 " %f",
  509.                 " %m",
  510.                 " %p",
  511.                 " %d",
  512.                 " %u",
  513.                 " %<",
  514.                 " %>",
  515.                 " %s",
  516.                 " %b",
  517.                 " %c",
  518.             };
  519.  
  520.             struct IntuiMessage    *Message;
  521.             BOOLEAN             Done = FALSE;
  522.             ULONG             MsgClass,
  523.                          MsgQualifier;
  524.             UWORD             MsgCode;
  525.             struct Gadget        *MsgGadget;
  526.  
  527.             GuideContext(CONTEXT_PARAMETERS);
  528.  
  529.             PushWindow(PanelWindow);
  530.  
  531.             LT_ShowWindow(Handle,TRUE);
  532.  
  533.             do
  534.             {
  535.                 if(Wait(PORTMASK(PanelWindow -> UserPort) | SIG_BREAK) & SIG_BREAK)
  536.                     break;
  537.  
  538.                 while(Message = (struct IntuiMessage *)LT_GetIMsg(Handle))
  539.                 {
  540.                     MsgClass    = Message -> Class;
  541.                     MsgQualifier    = Message -> Qualifier;
  542.                     MsgCode        = Message -> Code;
  543.                     MsgGadget    = (struct Gadget *)Message -> IAddress;
  544.  
  545.                     LT_ReplyIMsg(Message);
  546.  
  547.                     if(MsgClass == IDCMP_CLOSEWINDOW)
  548.                         Done = TRUE;
  549.  
  550.                     if(MsgClass == IDCMP_GADGETUP)
  551.                     {
  552.                         switch(MsgGadget -> GadgetID)
  553.                         {
  554.                             case GAD_USE:
  555.  
  556.                                 strcpy(Command,LocalCommand);
  557.  
  558.                                 Result = Done = TRUE;
  559.                                 break;
  560.  
  561.                             case GAD_CANCEL:
  562.  
  563.                                 Done = TRUE;
  564.                                 break;
  565.  
  566.                             default:
  567.  
  568.                                 if(MsgGadget -> GadgetID >= GAD_BUTTON1 && MsgGadget -> GadgetID <= GAD_BUTTON8)
  569.                                 {
  570.                                     LT_LockWindow(PanelWindow);
  571.  
  572.                                     if(strlen(LocalCommand) + 3 < 255)
  573.                                     {
  574.                                         strcat(LocalCommand,Strings[MsgGadget -> GadgetID - GAD_BUTTON1]);
  575.  
  576.                                         LT_SetAttributes(Handle,GAD_COMMAND,
  577.                                             GTST_String,        LocalCommand,
  578.                                             LAST_CursorPosition,    -1,
  579.                                         TAG_DONE);
  580.                                     }
  581.                                     else
  582.                                         DisplayBeep(PanelWindow -> WScreen);
  583.  
  584.                                     LT_UnlockWindow(PanelWindow);
  585.                                 }
  586.  
  587.                                 break;
  588.                         }
  589.                     }
  590.  
  591.                     if(MsgClass == IDCMP_IDCMPUPDATE)
  592.                     {
  593.                         struct FileRequester    *FileRequest;
  594.                         STRPTR             Index,Name,Args;
  595.  
  596.                         LT_LockWindow(PanelWindow);
  597.  
  598.                         strcpy(SharedBuffer,LocalCommand);
  599.  
  600.                         Index = PathPart(SharedBuffer);
  601.  
  602.                         *Index++ = 0;
  603.  
  604.                         Name = Index;
  605.  
  606.                         while(*Index && *Index != ' ')
  607.                             Index++;
  608.  
  609.                         if(*Index == ' ')
  610.                         {
  611.                             *Index = 0;
  612.  
  613.                             Args = &LocalCommand[(ULONG)Index - (ULONG)&SharedBuffer[0] + 1];
  614.                         }
  615.                         else
  616.                             Args = NULL;
  617.  
  618.                         if(FileRequest = GetFile(Window,LocaleString(MSG_XFER_SELECT_COMMAND_TXT),SharedBuffer,Name,SharedBuffer,NULL,FALSE,FALSE,FALSE,LocaleString(MSG_GLOBAL_SELECT_TXT),FALSE))
  619.                         {
  620.                             LONG Len = strlen(SharedBuffer);
  621.  
  622.                             if(Len < 253 && Args)
  623.                             {
  624.                                 strcat(SharedBuffer," ");
  625.  
  626.                                 Len++;
  627.  
  628.                                 memcpy(SharedBuffer + Len,Args,255 - Len);
  629.  
  630.                                 SharedBuffer[255] = 0;
  631.                             }
  632.  
  633.                             LT_SetAttributes(Handle,GAD_COMMAND,
  634.                                 GTST_String,SharedBuffer,
  635.                             TAG_DONE);
  636.  
  637.                             FreeAslRequest(FileRequest);
  638.                         }
  639.  
  640.                         LT_UnlockWindow(PanelWindow);
  641.                     }
  642.                 }
  643.             }
  644.             while(!Done);
  645.  
  646.             PopWindow();
  647.         }
  648.  
  649.         LT_DeleteHandle(Handle);
  650.     }
  651.  
  652.     return(Result);
  653. }
  654.